﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BL;
using BaseUI;
using IUI;

namespace WebUI
{
    public partial class WebForm1 : /*System.Web.UI.Page*/ BaseWebPage<LoginController>, ILogin
    {
        protected void Page_Load(object sender, EventArgs e) { }
        
        private event EventHandler _click_LoginButton;
        
        protected void btn_Login_Click(object sender, EventArgs e)
        {
            if (_click_LoginButton != null) _click_LoginButton(this, null);
        }

        #region Члены ILogin

        public string strLogin
        {
            get { 
                return txtBx_Login.Text; 
            }
        }

        public string strPasswd
        {
            get { 
                return txtBx_Passwd.Text; 
            }
        }

        public EventHandler Click_LoginButton
        {
            get { return _click_LoginButton; }
            set { _click_LoginButton = value; }
        }

        public void ShowError(bool empty)
        {
            if (empty)
            {
                //MessageBox.Show("Login & Password fields shouldn't be empty",
                //                "Input Error",
                //                MessageBoxButtons.OK);
                this.lbl_error.Text = "Input Error : Login & Password fields shouldn't be empty";
            }
            else
            {
                //MessageBox.Show("Check Login and Password", "Login State", MessageBoxButtons.OK);
                this.lbl_error.Text = "Login State : Check Login and Password";
            }
        }

        #endregion        
       
    }
}
